package homework;

import java.util.Scanner;

public class ChatThread extends Thread{

    @Override
    public void run() {
        Scanner sc = new Scanner(System.in);
        while (true){
            System.out.println("是否结束？（Y/y结束）");
            String input = sc.nextLine().trim().toLowerCase();
            if("y".equals(input)){
                break;
            }
        }

        sc.close();
    }
}
